<?php // view_authors.php
require_once('./inc/inc.common.php');
$tmpl 		= new mvTemplate();
$tmpl->page_title('View All Articles');

if(!isset($_SESSION['user']) || !$_SESSION['user']->isAdmin){
	mvError::userError('Not Authorized', 'You are not authorized to view that page.');
	header('location: index.php');
	die();
}

$sql = "SELECT * FROM authors ORDER by registrationDate DESC";
$parms = array();
$query = $GLOBALS['db']->prepare_execute($sql, $parms);
$results = $query->fetchall();

$tmpl->assign('results', $results);

$tmpl->page_display('a_viewauthors.tpl');
?>